package com.voilet.interview.databing;

import android.os.Bundle;
import android.view.View;

import com.voilet.interview.R;
import com.voilet.interview.databinding.ActivityDataBingBinding;

import java.util.Date;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

/**
 * Created by kan212 on 2019/4/13.
 */

public class DataBindActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_data_bing);

        ActivityDataBingBinding binding = DataBindingUtil.setContentView(this,R.layout.activity_data_bing);
        SwordsMan swordsMan = new SwordsMan("hahah","hh");
        binding.setSwordsMan(swordsMan);
        binding.setTime(new Date());
        binding.tvName.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
            }
        });


    }
}
